package com.github.ecbp.user.service.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.github.ecbp.common.data.mapper.BaseMapper;
import com.github.ecbp.user.service.entity.TAdmin;
import com.github.ecbp.user.service.entity.TAdminRoleRelation;
import com.github.ecbp.user.service.vo.AdminRoleIdVo;
import com.github.ecbp.user.service.vo.ListInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 后台用户和角色关系表 Mapper 接口
 * </p>
 *
 * @author zj2626
 * @since 2020-03-19
 */
public interface AdminRoleRelationMapper extends BaseMapper<TAdminRoleRelation> {
    /**
     * 通过用户ID查询角色ID
     *
     * @param wrapper
     * @return java.util.List<com.ecbp.service.user.vo.AdminRoleIdVo>
     * @author zj2626
     * @date 2020/5/12
     */
    List<AdminRoleIdVo> getRoleIdByAdminId(@Param(Constants.WRAPPER) Wrapper<TAdminRoleRelation> wrapper);

    /**
     * 通过角色ID查询用户ID
     *
     * @param wrapper
     * @return java.util.List<com.ecbp.service.user.entity.TAdmin>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TAdmin> getAdminIdByRoleId(@Param(Constants.WRAPPER) Wrapper<TAdminRoleRelation> wrapper);

    /**
     * 通过角色ID查询统计数据
     *
     * @param wrapper
     * @return java.util.List<com.ecbp.service.user.vo.ListInfoVo>
     * @author zj2626
     * @date 2020/5/12
     */
    List<ListInfoVo> pageInfoList(@Param(Constants.WRAPPER) Wrapper<TAdminRoleRelation> wrapper);
}
